package cn.com.dhcc.ddi.datasource.vo.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.ddi.datasource.vo.TableColVo;
/**
 * 
 * 表列信息RowWapper
 * @Author: fxx
 * @date: 2017-5-16
 *
 */
public class TableColRowWapper implements RowMapper<TableColVo> {
	@Override
	public TableColVo mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		TableColVo vo = new TableColVo();
		vo.setId(rs.getString("id"));
		vo.setTableId(rs.getString("table_id"));
		vo.setColName(rs.getString("col_name"));
		vo.setColType(rs.getString("col_type"));
		vo.setColDefault(rs.getString("col_default"));
		vo.setColComment(rs.getString("col_comment"));
		vo.setIsPk(rs.getString("is_pk"));
		vo.setIsIc(rs.getString("is_ic"));
		vo.setFkTableName(rs.getString("fk_table_name"));
		vo.setFkTablecolName(rs.getString("fk_tablecol_name"));
		vo.setMtime(rs.getTimestamp("mtime"));
		
		return vo;
	}
}
